// Decompiled on 周六 2月 22 19:31:49 CST 2025 with Zomboid Decompiler v0.1.3 using Vineflower.
package zombie.core.opengl;

public abstract class IOpenGLState<T extends IOpenGLState.Value> {
    protected T currentValue = this.defaultValue();
    private boolean dirty = true;

    public void set(T value) {
        if (this.dirty || !value.equals(this.currentValue)) {
            this.setCurrentValue((T)value);
            this.Set((T)value);
        }
    }

    void setCurrentValue(T value) {
        this.dirty = false;
        this.currentValue.set(value);
    }

    public void setDirty() {
        this.dirty = true;
    }

    T getCurrentValue() {
        return this.currentValue;
    }

    abstract T defaultValue();

    abstract void Set(T var1);

    public interface Value {
        IOpenGLState.Value set(IOpenGLState.Value other);
    }
}
